<?php

namespace App\Exceptions;

use Exception;

class ExceptionApi extends Exception
{

    protected $apiCode=400;

    public function __construct($message = "", $code = 400)
    {
        $this->apiCode = $code;
        parent::__construct($message, 200);
    }

    public function render(){
        return response()->json(['msg' => $this->message,'code'=>$this->apiCode,'data'=>null], 200);
    }

}
